﻿using System;
using System.Collections.Generic;
using System.Text;

namespace IllustratedCsharp7_ch18Generic_InterfaceTwoType
{
    interface ImyIfc<T>
     {
        T ReturnIt(T inValue);
     }
    class Simple : ImyIfc<int>, ImyIfc<string>   //非泛型类
    {
        public string ReturnIt(string inValue) //实现int类型接口
        {
            return inValue;
        }

        public int ReturnIt(int inValue)        //实现string类型接口
        {
            return inValue;
        }
    }

    class GenericInterfaceImplientTwoITypenterface
    {
      
      static void _Main()
        {
            Simple trivial = new Simple();
            Console.WriteLine($"{trivial.ReturnIt(5)}");
            Console.WriteLine($"{trivial.ReturnIt("Hi there.")}");
        }
    }
}
